<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人信息</title>
    <link rel="stylesheet" href="../CSS/grxx-css.css">
    <link rel="stylesheet" href="../CSS/public-css.css">
    <link rel="stylesheet" href="../CSS/font-awesome.min.css">
    <link rel="stylesheet" href="../CSS/head.css">
</head>
<script src="../js/jquery-3.4.1.min.js"></script>

<body>
<div class="main-div">
    <div class="header-div">
        <div class="logo-div">
            <img src="../img/goktech-img/images/logo.png" alt="无法加载图片">
        </div>
        <div class="form-div">
            <form action="">
                <input type="search" placeholder="热门搜索：干花花瓶">
                <input type="button">
            </form>
        </div>
    </div>
    <div class="body-div">
        <div class="nav-div">
            <ul>
                <li><a href="../homePage.jsp">商品首页</a></li>
                <li><a href="#">所有商品</a>
                    <div class="dropdown-content-one">
                        <div class="wrapper">
                            <a href="#">
                                <div class="img-div-one">
                                    <img src="../img/WebProgram/img/nav1.jpg" alt="无法加载图片">
                                </div>
                                <div class="dropdown-text-div">
                                    <span>浓情欧式</span>
                                </div>
                            </a>
                            <a href="#">
                                <div class="img-div-one">
                                    <img src="../img/WebProgram/img/nav2.jpg" alt="无法加载图片">
                                </div>
                                <div class="dropdown-text-div">
                                    <span>浪漫美式</span>
                                </div>
                            </a>
                            <a href="#">
                                <div class="img-div-one">
                                    <img src="../img/WebProgram/img/nav3.jpg" alt="无法加载图片">
                                </div>
                                <div class="dropdown-text-div">
                                    <span>雅致中式</span>
                                </div>
                            </a>
                            <a href="#">
                                <div class="img-div-one">
                                    <img src="../img/WebProgram/img/nav6.jpg" alt="无法加载图片">
                                </div>
                                <div class="dropdown-text-div">
                                    <span>简约现代</span>
                                </div>
                            </a>
                            <a href="#">
                                <div class="img-div-one">
                                    <img src="../img/WebProgram/img/nav5.jpg" alt="无法加载图片">
                                </div>
                                <div class="dropdown-text-div">
                                    <span class="text-span">创意装饰</span>
                                </div>
                            </a>
                        </div>
                    </div>
                </li>
                <li><a href="#">装饰摆件</a></li>
                <li><a href="#">布艺软饰</a></li>
                <li><a href="#">墙饰壁挂</a></li>
                <li><a href="#">蜡艺香薰</a></li>
                <li><a href="#">创意家居</a></li>
            </ul>
        </div>
        <div class="location-div">
            <div class="parcel-div">
                <a href="../homePage.jsp">首页</a>
                <span>&nbsp;&nbsp;/&nbsp;&nbsp;</span>
                <a href="./grxx.jsp">账户管理</a>
                <span>&nbsp;&nbsp;/&nbsp;&nbsp;</span>
                <a href="#">个人信息</a>
            </div>
        </div>
        <div class="wrapper-div">
            <div class="userManage-div">
                <span><a href="./goods-Manage.jsp">商品管理</a></span>
            </div>
            <div class="parcel-div">
                <div class="sideleft">
                    <div class="parcel-div">
                        <div class="head-portrait-div">
                            <img src="<%--${user.uImg}--%>" alt="无法加载图片" class="img1">
                        </div>
                        <div class="userInfo-div">
                            <span>${user.uUsername}</span>&nbsp;&nbsp;
                            <span><a href="${pageContext.request.contextPath}/user?method=logout">[退出登录]</a></span>
                        </div>
                    </div>
                    <div class="nav-div">
                        <div class="mydeal-div">
                            <ul>
                                <li><a href="#">我的交易</a></li>
                                <li><a href="gwc.jsp">我的购物车</a></li>
                                <li><a href="#">我的订单</a></li>
                                <li><a href="#">评价晒单</a></li>
                            </ul>
                        </div>
                        <div class="grzx-div">
                            <ul>
                                <li><a href="#">个人中心</a></li>
                                <li><a href="grzx.jsp">我的中心</a></li>
                                <li><a href="addrManage.jsp">地址管理</a></li>
                            </ul>
                        </div>
                        <div class="accountManage-div">
                            <ul>
                                <li><a href="#">账户管理</a></li>
                                <li><a href="grxx.jsp">个人信息</a></li>
                                <li><a href="updatePwd.jsp">修改密码</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="sideright">
                    <div class="top-div">
                        <span>个人信息</span>
                    </div>
                    <div class="bottom-div">
                        <div class="head-portrait-div">
                            <img src="<%--${user.uImg}--%>" alt="无法加载图片"  class="img1">
<%--                            <img src="..\img\upload\avatar\1\11\79b1a67102474dc28f0884929bda682a_787.png">--%>
                            <span>修改头像</span>
                            
                        </div>
                        <div class="grxx-div">
                            <div class="title">
                                <span>基础资料</span>
                                <span>编辑</span>
                            </div>
                            <div><span class="uName"><%--姓名：${user.uName}--%></span></div>
                            <div><span class="uBirthday"><%--生日：${user.uBirthday}--%></span></div>
                            <div>
                                <span class="uSex"><%--性别：${user.uSex}--%>
<%--                                    <c:if test="<%= user.getGender() == 1%>">女</c:if>--%>
<%--                                    <c:if test="<%= user.getGender() == 0%>">男</c:if>--%>
                                </span>
                            </div>
                            <div><span>高级设置</span></div>
                            <div>
                                <span>账号地区：${user.uArea}</span>
                                <span>修改</span>
                            </div>
                        </div>
                    </div>
                </div>
                <!--遮罩-->
                <div class="mask"></div>
            </div>
        </div>
    </div>
    <div class="footer-div">
        <div class="top-div">
            <div class="parcel-div">
                <div class="clearfix">
                    <img src="../img/temp1/foot1.png" alt="无法加载图片">
                    <span>7天无理由退货</span>
                </div>
                <div class="clearfix">
                    <img src="../img/temp1/foot2.png" alt="无法加载图片">
                    <span>15天免费换货</span>
                </div>
                <div class="clearfix">
                    <img src="../img/temp1/foot3.png" alt="无法加载图片">
                    <span>满599包邮</span>
                </div>
                <div class="clearfix">
                    <img src="../img/temp1/foot4.png" alt="无法加载图片">
                    <span>手机特色服务</span>
                </div>
            </div>
        </div>
        <div class="bottom-div">
            <p>最家家居&copy;2013-2017公司版权所有 京ICP备080100-44备0000111000号<br>
                违法和不良信息举报电话:400-800-8200,本网站所列数据,除特殊说明,所有数据均出自我司实验室测试
            </p>
        </div>
    </div>
    <!--编辑头像-->
    <div class="edit-portrait-div">
        <div class="top-div">
            <span>修改头像</span>
        </div>
        <div class="bottom-div">
            <div class="parcel-div">
                <span>请上传图片</span>
                <form action="${pageContext.request.contextPath}/user?method=fileUpload" method="post" enctype="multipart/form-data">
                    <%--                    <button class="upload-button">--%>
                    <%--                        <span class="fa fa-cloud-upload fa-lg"></span>--%>
                    <%--                        上传头像--%>
                    <%--                    </button>--%>
<%--                    <input id="selectFile" type="file" class="clip" name="file1">--%>
<%--                    <label for="selectFile" class="button">选择图片</label>--%>
                    <input type="file" name="file1">
                    <span>jpg或png,大小不超过2M</span>
                    <input type="submit">
                </form>
            </div>
        </div>
        <div class="cancel">取消</div>
    </div>
    <!--编辑个人资料-->
    <div class="edit-personal-data">
        <div class="top-div">
            <span>修改头像</span>
        </div>
        <div class="bottom-div">
            <div class="parcel-div">
                <input class="real-name" type="text" placeholder="请填写真实姓名">
                <div class="name-tip"></div>
                <input class="birthday" type="text" placeholder="请填写出生日期(格式:2000-01-01)">
                <div class="birthday-tip"></div>
                <input class="sex" type="text" placeholder="请填写性别">
                <div class="sex-tip"></div>
            </div>
            <div class="save-info-btn">
                <button class="btn">保存</button>
                <button>取消</button>
            </div>
        </div>
        <div class="tip">
            <span>保存成功</span>
        </div>
    </div>
</div>
</body>
<script src="../js/grxx-js.js"></script>

<script>
    $(function () {
<%--        <c:if test="${k=='1'}">--%>
<%--            alert("上传成功！");--%>
<%--            window.location.href = "${pageContext.request.contextPath}/ProgramJSP/grxx.jsp";--%>
<%--        </c:if>--%>
<%--        <c:if test="${k=='0'}">--%>
<%--            alert("上传失败！");--%>
<%--            window.location.href = "${pageContext.request.contextPath}/ProgramJSP/grxx.jsp";--%>
<%--        </c:if>--%>
        $(".cancel").click(function () {
            $(".mask").attr("style", "");
            $(".edit-portrait-div").attr("style", "");
        });
        $(".btn").click(function () {
            $.ajax({
                url: "${pageContext.request.contextPath}/user?method=ModifyInformation",
                type: "POST",
                data: {"uName": $(".real-name").val(), "uBirthday": $(".birthday").val(), "uSex": $(".sex").val()},
                dataType: "json",
                success: function (message) {

                }
            });
        });
        $.ajax({
            url: "${pageContext.request.contextPath}/user?method=selectByUid",
            type: "POST",
            dataType: "json",
            success: function (message) {
                var str = message.uBirthday;
                $(".uName").html("姓名：" + message.uName);
                $(".uSex").html("性别：" + message.uSex);
                $(".img1").attr("src",message.uImg);
                $(".uBirthday").html("生日：${user.uBirthday}");
            },
            error: function (jqXHR) {
                alert("失败!");
            }
        });
    });
</script>

</html>
